package com.mashibing.api.advice;

/**
 * @author LengMao
 * @date 2023/8/4 21:44
 */

import com.mashibing.common.exception.ApiException;
import com.mashibing.api.util.R;
import com.mashibing.api.vo.ResultVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ApiExceptionHandler {

    @ExceptionHandler(ApiException.class)
    public ResultVO apiExcetion(ApiException ex){
        return R.error(ex);
    }
}
